<?php defined('SYSPATH') OR die('No direct access allowed.');
if (count($comments)>0):?>
	<li class="header">
		<p class="title"><?=Kohana::lang('comment.header')?></p>
		<?=$pages?>
	</li>
<?endif;
foreach($comments as $comment): ?>
<!-- BEGIN COMMENT ITEM -->
	<li>
		<dl class="comment rounded">
			<dt>
				<? echo View::factory('forum/blocks/userinfo')->set('user', $comment->author) ?>
			</dt>
			<dd class="header">
				<a name="comment_<?=$comment->id?>"></a><span class="ts leftside">[ <?=cmsformat::timestamp('forum.post',$comment->created)?> ]</span>
				<span class="manage">
					<? if (access::can($comment, 'update')):?>
					<form action='/<?=Router::uri('forum', array('controller'=>'comment', 'method'=>'edit'))?>' method='POST'>
						<?=form::hidden('id', $comment->id)?>
						<input type='submit' value='edit' />
					</form>
					<? endif; ?>
					<? if (access::can($comment, 'delete')):?>
					<form action='/<?=Router::uri('forum', array('controller'=>'comment', 'method'=>'delete'))?>' method='POST'>
						<?=form::hidden('id', $comment->id)?>
						<input type='submit' value='delete' />
					</form>
					<? endif; ?>
				</span>
			</dd>
			<dd class="body"><div><?=$comment->text?></div></dd>
			<dd class="footer"></dd>
		</dl>
	</li>
	<? Event::run('forum.comment.render', $comment);?>
<!-- END COMMENT ITEM -->
	<? endforeach; ?>
